<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP, MagicHash #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-orphans #-}</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Module      : Data.Text.Show</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Copyright   : (c) 2009-2015 Bryan O'Sullivan</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- License     : BSD-style</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Maintainer  : bos@serpentine.com</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Stability   : experimental</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Portability : GHC</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Text.Show</span><span>
</span><span id="line-16"></span><span>    </span><span class="hs-special">(</span><span>
</span><span id="line-17"></span><span>      </span><span class="annot"><a href="Data.Text.Show.html#singleton"><span class="hs-identifier">singleton</span></a></span><span>
</span><span id="line-18"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Show.html#unpack"><span class="hs-identifier">unpack</span></a></span><span>
</span><span id="line-19"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Show.html#unpackCString%23"><span class="hs-identifier">unpackCString#</span></a></span><span>
</span><span id="line-20"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.ST.html#"><span class="hs-identifier">Control.Monad.ST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier">ST</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Internal.html"><span class="hs-identifier">Data.Text.Internal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier">Text</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.html#empty_"><span class="hs-identifier">empty_</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.html#safe"><span class="hs-keyword">safe</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Internal.Fusion.html"><span class="hs-identifier">Data.Text.Internal.Fusion</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.html#stream"><span class="hs-identifier">stream</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Fusion.html#unstream"><span class="hs-identifier">unstream</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Internal.Unsafe.Char.html"><span class="hs-identifier">Data.Text.Internal.Unsafe.Char</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Unsafe.Char.html#unsafeWrite"><span class="hs-identifier">unsafeWrite</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#"><span class="hs-identifier">GHC.Prim</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Addr%23"><span class="hs-identifier">Addr#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.Text.Array.html"><span class="hs-identifier">Data.Text.Array</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">A</span></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html"><span class="hs-identifier">Data.Text.Internal.Fusion.Common</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">S</span></span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#"><span class="hs-identifier">GHC.CString</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">GHC</span></span><span class="hs-cpp">

#if defined(ASSERTS)
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">GHC.Stack</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">HasCallStack</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-36"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679107633"><span id="local-6989586621679107635"><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">Text</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-37"></span><span>    </span><span id="local-6989586621679107627"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; Text -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#showsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span id="local-6989586621679107625"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679107625"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679107624"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679107624"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span id="local-6989586621679107623"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679107623"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; String -&gt; ShowS
forall a. Show a =&gt; Int -&gt; a -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#showsPrec"><span class="hs-identifier hs-var">showsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679107625"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; String
</span><a href="Data.Text.Show.html#unpack"><span class="hs-identifier hs-var">unpack</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679107624"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679107623"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-comment">-- | /O(n)/ Convert a 'Text' into a 'String'.  Subject to fusion.</span><span>
</span><span id="line-40"></span><span class="annot"><a href="Data.Text.Show.html#unpack"><span class="hs-identifier hs-type">unpack</span></a></span><span> </span><span class="hs-glyph">::</span><span class="hs-cpp">
#if defined(ASSERTS)
</span><span>  </span><span class="hs-identifier">HasCallStack</span><span> </span><span class="hs-glyph">=&gt;</span><span class="hs-cpp">
#endif
</span><span>  </span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-45"></span><span id="unpack"><span class="annot"><span class="annottext">unpack :: Text -&gt; String
</span><a href="Data.Text.Show.html#unpack"><span class="hs-identifier hs-var hs-var">unpack</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; String
forall a. Stream a -&gt; [a]
</span><a href="Data.Text.Internal.Fusion.Common.html#unstreamList"><span class="hs-identifier hs-var">S.unstreamList</span></a></span><span> </span><span class="annot"><span class="annottext">(Stream Char -&gt; String) -&gt; (Text -&gt; Stream Char) -&gt; Text -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span>
</span><span id="line-46"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Show.html#unpack"><span class="hs-pragma hs-type">unpack</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span class="hs-comment">-- | /O(n)/ Convert a literal string into a 'Text'.</span><span>
</span><span id="line-49"></span><span class="hs-comment">--</span><span>
</span><span id="line-50"></span><span class="hs-comment">-- This is exposed solely for people writing GHC rewrite rules.</span><span>
</span><span id="line-51"></span><span class="hs-comment">--</span><span>
</span><span id="line-52"></span><span class="hs-comment">-- @since 1.2.1.1</span><span>
</span><span id="line-53"></span><span class="annot"><a href="Data.Text.Show.html#unpackCString%23"><span class="hs-identifier hs-type">unpackCString#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Addr%23"><span class="hs-identifier hs-type">Addr#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-54"></span><span id="unpackCString%23"><span class="annot"><span class="annottext">unpackCString# :: Addr# -&gt; Text
</span><a href="Data.Text.Show.html#unpackCString%23"><span class="hs-identifier hs-var hs-var">unpackCString#</span></a></span></span><span> </span><span id="local-6989586621679107620"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679107620"><span class="hs-identifier hs-var">addr#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; Stream Char
</span><a href="Data.Text.Internal.Fusion.Common.html#streamCString%23"><span class="hs-identifier hs-var">S.streamCString#</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679107620"><span class="hs-identifier hs-var">addr#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-55"></span><span class="hs-pragma">{-# NOINLINE</span><span> </span><span class="annot"><a href="Data.Text.Show.html#unpackCString%23"><span class="hs-pragma hs-type">unpackCString#</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span class="hs-pragma">{-# RULES</span><span> </span><span class="annot"><span class="hs-pragma">&quot;TEXT literal&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679107618"><span class="annot"><a href="#local-6989586621679107618"><span class="hs-pragma hs-var">a</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-58"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#map"><span class="hs-pragma hs-type">S.map</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.html#safe"><span class="hs-pragma hs-type">safe</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#streamList"><span class="hs-pragma hs-type">S.streamList</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackCString%23"><span class="hs-pragma hs-type">GHC.unpackCString#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679107618"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-59"></span><span>      </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Show.html#unpackCString%23"><span class="hs-pragma hs-type">unpackCString#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679107618"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="hs-pragma">{-# RULES</span><span> </span><span class="annot"><span class="hs-pragma">&quot;TEXT literal UTF8&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679107615"><span class="annot"><a href="#local-6989586621679107615"><span class="hs-pragma hs-var">a</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-62"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#map"><span class="hs-pragma hs-type">S.map</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.html#safe"><span class="hs-pragma hs-type">safe</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#streamList"><span class="hs-pragma hs-type">S.streamList</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackCStringUtf8%23"><span class="hs-pragma hs-type">GHC.unpackCStringUtf8#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679107615"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-63"></span><span>      </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Show.html#unpackCString%23"><span class="hs-pragma hs-type">unpackCString#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679107615"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span class="hs-pragma">{-# RULES</span><span> </span><span class="annot"><span class="hs-pragma">&quot;TEXT empty literal&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span>
</span><span id="line-66"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#map"><span class="hs-pragma hs-type">S.map</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.html#safe"><span class="hs-pragma hs-type">safe</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#streamList"><span class="hs-pragma hs-type">S.streamList</span></a></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">]</span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-67"></span><span>      </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.html#empty_"><span class="hs-pragma hs-type">empty_</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span class="hs-pragma">{-# RULES</span><span> </span><span class="annot"><span class="hs-pragma">&quot;TEXT singleton literal&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679107614"><span class="annot"><a href="#local-6989586621679107614"><span class="hs-pragma hs-var">a</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-70"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#map"><span class="hs-pragma hs-type">S.map</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.html#safe"><span class="hs-pragma hs-type">safe</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#streamList"><span class="hs-pragma hs-type">S.streamList</span></a></span><span> </span><span class="hs-pragma">[</span><span class="annot"><a href="#local-6989586621679107614"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">]</span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-71"></span><span>      </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Show.html#singleton_"><span class="hs-pragma hs-type">singleton_</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679107614"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-72"></span><span>
</span><span id="line-73"></span><span class="hs-comment">-- | /O(1)/ Convert a character into a Text.  Subject to fusion.</span><span>
</span><span id="line-74"></span><span class="hs-comment">-- Performs replacement on invalid scalar values.</span><span>
</span><span id="line-75"></span><span class="annot"><a href="Data.Text.Show.html#singleton"><span class="hs-identifier hs-type">singleton</span></a></span><span> </span><span class="hs-glyph">::</span><span class="hs-cpp">
#if defined(ASSERTS)
</span><span>  </span><span class="hs-identifier">HasCallStack</span><span> </span><span class="hs-glyph">=&gt;</span><span class="hs-cpp">
#endif
</span><span>  </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-80"></span><span id="singleton"><span class="annot"><span class="annottext">singleton :: Char -&gt; Text
</span><a href="Data.Text.Show.html#singleton"><span class="hs-identifier hs-var hs-var">singleton</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="annot"><span class="annottext">(Stream Char -&gt; Text) -&gt; (Char -&gt; Stream Char) -&gt; Char -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Stream Char
</span><a href="Data.Text.Internal.Fusion.Common.html#singleton"><span class="hs-identifier hs-var">S.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Stream Char) -&gt; (Char -&gt; Char) -&gt; Char -&gt; Stream Char
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="Data.Text.Internal.html#safe"><span class="hs-keyword hs-var">safe</span></a></span><span>
</span><span id="line-81"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Show.html#singleton"><span class="hs-pragma hs-type">singleton</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-pragma">{-# RULES</span><span> </span><span class="annot"><span class="hs-pragma">&quot;TEXT singleton&quot;</span></span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679107611"><span class="annot"><a href="#local-6989586621679107611"><span class="hs-pragma hs-var">a</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-84"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#singleton"><span class="hs-pragma hs-type">S.singleton</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.html#safe"><span class="hs-pragma hs-type">safe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679107611"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-85"></span><span>      </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Show.html#singleton_"><span class="hs-pragma hs-type">singleton_</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679107611"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span class="hs-comment">-- This is intended to reduce inlining bloat.</span><span>
</span><span id="line-88"></span><span class="annot"><a href="Data.Text.Show.html#singleton_"><span class="hs-identifier hs-type">singleton_</span></a></span><span> </span><span class="hs-glyph">::</span><span class="hs-cpp">
#if defined(ASSERTS)
</span><span>  </span><span class="hs-identifier">HasCallStack</span><span> </span><span class="hs-glyph">=&gt;</span><span class="hs-cpp">
#endif
</span><span>  </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-93"></span><span id="singleton_"><span class="annot"><span class="annottext">singleton_ :: Char -&gt; Text
</span><a href="Data.Text.Show.html#singleton_"><span class="hs-identifier hs-var hs-var">singleton_</span></a></span></span><span> </span><span id="local-6989586621679107610"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679107610"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array -&gt; Int -&gt; Int -&gt; Text
</span><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-var">Text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall s. ST s (MArray s)) -&gt; Array
</span><a href="Data.Text.Array.html#run"><span class="hs-identifier hs-var">A.run</span></a></span><span> </span><span class="annot"><span class="annottext">forall s. ST s (MArray s)
</span><a href="#local-6989586621679107607"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679107606"><span class="hs-identifier hs-var">len</span></a></span><span>
</span><span id="line-94"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679107605"><span class="annot"><a href="#local-6989586621679107607"><span class="hs-identifier hs-type">x</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679107605"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Array.html#MArray"><span class="hs-identifier hs-type">A.MArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679107605"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-95"></span><span>        </span><span id="local-6989586621679107607"><span class="annot"><span class="annottext">x :: forall s. ST s (MArray s)
</span><a href="#local-6989586621679107607"><span class="hs-identifier hs-var hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679107600"><span class="annot"><span class="annottext">MArray s
</span><a href="#local-6989586621679107600"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; ST s (MArray s)
forall s. Int -&gt; ST s (MArray s)
</span><a href="Data.Text.Array.html#new"><span class="hs-identifier hs-var">A.new</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679107606"><span class="hs-identifier hs-var">len</span></a></span><span>
</span><span id="line-96"></span><span>               </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">MArray s -&gt; Int -&gt; Char -&gt; ST s Int
forall s. MArray s -&gt; Int -&gt; Char -&gt; ST s Int
</span><a href="Data.Text.Internal.Unsafe.Char.html#unsafeWrite"><span class="hs-identifier hs-var">unsafeWrite</span></a></span><span> </span><span class="annot"><span class="annottext">MArray s
</span><a href="#local-6989586621679107600"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679107598"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-97"></span><span>               </span><span class="annot"><span class="annottext">MArray s -&gt; ST s (MArray s)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">MArray s
</span><a href="#local-6989586621679107600"><span class="hs-identifier hs-var">arr</span></a></span><span>
</span><span id="line-98"></span><span>        </span><span id="local-6989586621679107606"><span class="annot"><span class="annottext">len :: Int
</span><a href="#local-6989586621679107606"><span class="hs-identifier hs-var hs-var">len</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679107598"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\x10000'</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-99"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-100"></span><span>        </span><span id="local-6989586621679107598"><span class="annot"><span class="annottext">d :: Char
</span><a href="#local-6989586621679107598"><span class="hs-identifier hs-var hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="Data.Text.Internal.html#safe"><span class="hs-keyword hs-var">safe</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679107610"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-101"></span><span class="hs-pragma">{-# NOINLINE</span><span> </span><span class="annot"><a href="Data.Text.Show.html#singleton_"><span class="hs-pragma hs-type">singleton_</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-102"></span></pre></body></html>